<template>
  <van-nav-bar title="吃药提醒" left-arrow @click-left="router.back()" />

  <div class="detail-container">
    <div class="detail-card">
      <div class="detail-header">
        <span class="detail-title">{{ detail.title }}</span>
        <span class="detail-date">{{ detail.date }}</span>
      </div>
      <div class="detail-desc">{{ detail.desc }}</div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { useRoute, useRouter } from 'vue-router'

const router = useRouter()
const route = useRoute()

// 假设实际项目中你会根据 route.params.id 请求后端获取详情
const detail = ref({
  title: '吃药提醒',
  date: '2021-05-21',
  desc: '今日早餐前需服用二甲双胍，服用量2mg！'
})

// 你可以根据 route.params.id 动态获取内容
// const id = route.params.id
// 请求接口获取详情...
</script>

<style scoped>
.detail-container {
  background: #f7f8fa;
  min-height: 100vh;
  padding: 16px 0;
}
.detail-card {
  background: #fff;
  border-radius: 14px;
  margin: 0 12px;
  padding: 20px 18px 40px 18px;
  box-shadow: 0 2px 8px 0 rgba(0,0,0,0.02);
}
.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.detail-title {
  font-size: 16px;
  font-weight: 600;
  color: #222;
}
.detail-date {
  color: #bcbcbc;
  font-size: 13px;
}
.detail-desc {
  font-size: 14px;
  color: #888;
  margin-top: 6px;
  line-height: 1.7;
}
</style>